home *** CD-ROM | disk | FTP | other *** search
Wrap
OPT PREPROCESS MODULE 'feelin','libraries/feelin','a4', 'intuition/intuition', 'graphics/rastport','graphics/gfxmacros' PROC main() DEF c,w,w2,font,myback[16]:STRING,t1,t2,b sys_SGlob() font := 'Garnet/16' StringF(myback,'F:\h\0',{drawfunc}) t1 := 'Feelin : Active' t2 := 'Feelin : Inactive' IF feelinbase := OpenLibrary('feelin.library',FV_VERSION) c := ClientObject, FA_Client_Title, 'Demo_00', Child, w := WindowObject, FA_ID, "MAIN", FA_Back, myback, FA_ContextHelp, '`c`bThree colored buttons`n\t`jIt is possible for `ueach`n gadget\nto have its very own `Sscolor scheme`Sn.\nAll you have to do is define\none of the `SsFA_Pen_Xxx`Sn attribute.`z', FA_Window_Title, t1, Child, HGroup, Child, TextObject, FA_Font,font, FA_Back,'c:FF0000', FA_AltBack,'c:FF8080', FA_Text,'Red', InputRelease, FA_ContextHelp,'Red color', End, Child, b := TextObject, FA_Font,font, FA_Back,'c:00FF00', FA_AltBack,'c:80FF80', FA_Text,'Green', InputToggle, FA_ContextHelp,'Green color', End, Child, TextObject, FA_Font,font, FA_Back,'c:0000FF', FA_AltBack,'c:8080FF', FA_Text,'Blue', InputRelease, FA_ContextHelp,'Blue color', End, End, End, Child, w2 := WindowObject, FA_ID, "WIN2", FA_Window_Title, 'Window 2', FA_Back, myback, Child, HGroup, FA_FixedHeight,TRUE, Child, TextObject, FA_Font,font, FA_Back,'c:FF0000', FA_Text,'Lotan is', End, Child, BalanceID("BAL1"), Child, TextObject, FA_Font,font, FA_Back,'c:FF0000', FA_Text,'my lord', End, End, End, End IF c F_DoA(w,FM_Notify,[FA_Window_Active,TRUE,w,5, FM_Set,FA_Window_Title,t1,FA_NoNotify,TRUE]) F_DoA(w,FM_Notify,[FA_Window_Active,FALSE,w,5, FM_Set,FA_Window_Title,t2,FA_NoNotify,TRUE]) F_DoA(w,FM_Notify,[FA_Window_CloseRequest,TRUE, FV_Notify_Client, 2,FM_Client_ReturnID,FV_Client_Quit]) F_DoA(w2,FM_Notify,[FA_Window_CloseRequest,TRUE,b,3,FM_Set,FA_Selected,FALSE]) F_DoA(b,FM_Notify,[FA_Selected,FV_Notify_Always, w2,3,FM_Set,FA_Window_Open,FV_Notify_Value]) F_Set(w,FA_Window_Open,TRUE) F_DoA(c,FM_Client_Run,NIL) F_DisposeObj(c) ENDIF CloseLibrary(feelinbase) ENDIF ENDPROC PROC drawfunc(render=A0:PTR TO feelinRender,region=A2:PTR TO feelinRect) DEF x1,y1,x2,y2,x3, rp:PTR TO rastport,pt,op,ap,bp sys_RGlob() pt := [%1111111100000000, %0111111110000000, %0011111111000000, %0001111111100000, %0000111111110000, %0000011111111000, %0000001111111100, %0000000111111110, %0000000011111111, %1000000001111111, %1100000000111111, %1110000000011111, %1111000000001111, %1111100000000111, %1111110000000011, %1111111000000001]:INT /* pt := [%1111111100000000, %0111111110000000, %0011111111000000, %0001111111100000, %0000111111110000, %0000011111111000, %0000001111111100, %0000000111111110, %0000000011111111, %0000000111111110, %0000001111111100, %0000011111111000, %0000111111110000, %0001111111100000, %0011111111000000, %0111111110000000]:INT */ x1 := region.x1 ; x3 := region.x2 ; x2 := x3 - x1 / 3 + x1 y1 := region.y1 ; y2 := region.y2 ; rp := render.rport ap := render.pens[FV_Pen_Fill] bp := render.pens[FV_Pen_HalfShadow] _APen(bp) _Boxf(x1,y1,x2,y2) SetAfPt(rp,pt,4) _APen(ap) _BPen(bp) _Boxf(x2+1,y1,x3,y2) SetAfPt(rp,[-1,-1],0) ENDPROC